import {AfterViewInit, Component, Input, OnInit} from '@angular/core';
import 'tinymce';

import 'tinymce/plugins/table';
import 'tinymce/plugins/link';
import 'tinymce/themes/silver/theme';


declare var tinymce: any;

@Component({
  selector: 'project-form',
  templateUrl: './project-form.component.html'
})
export class ProjectFormComponent implements AfterViewInit {

  @Input() name;
  @Input() enName;
  @Input() code;
  @Input() id;
  @Input() owner;
  @Input() ownerEmail;
  @Input() introduction;
  toolbar = 'undo redo bold underline fontselect fontsizeselect formatselect forecolor backcolor' +
    ' numlist bullist alignleft aligncenter alignright outdent indent';

  constructor() {
  }

  ngAfterViewInit() {
    // setTimeout(() => {
    //   tinymce.init({
    //     selector: 'textarea#dhlEditor',
    //     base_url: '/assets',
    //     height: 400,
    //     width: '100%',
    //     toolbar: this.toolbar,
    //     readonly: false,
    //     menubar: false,
    //     branding: false,
    //     resize: false,
    //     statusbar: false,
    //     content_style: 'p {margin: 0px;}',
    //     setup: editor => {
    //       editor.on('keyup change', () => {
    //         const content = editor.getContent();
    //       });
    //     }
    //   });
    // }, 300);
  }


}




